/**
 * 
 */
package com.xb.demo14.filterchian;

/**
 * @author kexue
 *
 */
public abstract class AbstractLogFilter {

	private AbstractLogFilter next;

	public void logMessage(String message) {

		write(message);
		if (next != null) {
			next.logMessage(message);
		}
	}

	public String getPrefix() {
		String prefix = "[Thread-" + Thread.currentThread().getName() + "]";
		return prefix;
	}

	public abstract void write(String message);

	public void setNext(AbstractLogFilter next) {
		this.next = next;
	}

}
